var moon = function (exports) {
    const Unify = {
		/**排版*/
		displayRank(array,xNum=1,xDis=0,yDis=0,x=0,y=0,sign=1)
		{
			let display;
			for(let i=0;i<array.length;i++){
				display=array[i];
				display.x=x+parseInt(i%xNum)*(display.width+xDis)*sign;
				display.y=y+parseInt(i/xNum)*(display.height+yDis)*sign;
			}
		},
		getTimeFromat(t,n=0){
			t+=n;
			return t<10?'0'+t:t;
		},
		/**得到本地日期*/
		get date(){
			return new Date();
		},
		/**通过不同的随机种子得到的固定随机数*/
		set randomSeed(seed){
			this.seed=isNaN(seed)?1:seed;
		},
		get randomSeed(){
			if(this.seed){
				this.seed = (this.seed * 16807 + 0) % 2147483647;
				return this.seed / 2147483647.0;
			}else{
				console.warn('请先设置随机种子')
			}
		},
		/**计算两点间的距离*/
		getDistance(p1,p2){
			let x=p1.x-p2.x;
			let y=p1.y-p2.y;
			return Math.sqrt(x*x+y*y);
		},
		/**只根据一个条件排序,从小到大*/
		arraySortByParam(array,param,isReverse=false)
		{
			array.sort((a,b)=>{return a[param]-b[param];})
			if(isReverse) array.reverse();
		},
		/**根据两个以上条件排序,从小到大*/
		arraySortByParams(array,params,isReverse=false)
		{
			let len=params.length;
			array.sort((a,b)=>{
				for(let i=0;i<len;i++){
					let param=params[i];
					if(a[param]==b[param]){
						param=params[i==len-1?i:i+1];
						return a[param]-b[param];
					}else{
						return a[param]-b[param];
					}
				}
			})
			if(isReverse) array.reverse();
		},
    };
    const version = "1.1.0";
    exports.Unify = Unify;
    exports.version = version;
    Object.defineProperty(exports, "__esModule", {
        value: true
    });
    return exports
}
({});
